import { createRouter, createMemoryHistory, createWebHistory } from 'vue-router'

const routes =  [
    {
        path:'/',
        // name:Index,
        redirect:'/qunar/index'
        // component:()=>import('../views/index/index.vue')
    },
    {
        // 主页
        path:'/qunar/index',
        component:()=>import('../views/index/index.vue')
    },
    {
        // 订单页
        path:'/qunar/order',
        component:()=>import('../views/order/order.vue')
    },
    {
        // 客服
        path:'/qunar/service',
        component:()=>import('../views/service/service.vue')
    },
    {
        // 我的
        path:'/qunar/my',
        component:()=>import('../views/my/my.vue')
    },
    {
        // 登录注册
        path:'/qunar/login',
        component:()=>import ('../views/login/login.vue')
    },
    {
        // 详细信息
        path:'/qunar/detail',
        component:()=>import('../views/detail/detail.vue')
    }
]


const isServer = typeof window === 'undefined'

const history = isServer ? createMemoryHistory() : createWebHistory()

const router = createRouter({
    history,
  routes
})

export default router